/**
 * 
 */
package org.cuatrovientos.es;

import java.util.Random;

/**
 * @author Beatriz
 * class vehicle
 *
 */


public class Vehicle {
	protected String name;
	protected int speed=0;
	protected int acceleration=0;
	protected int purchase=0;
	
	/**
	 * string name
	 */
	public Vehicle(String name) {
		super();
		this.name = name;
		setup();
		
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	public int getAcceleration() {
		return acceleration;
	}

	public void setAcceleration(int acceleration) {
		this.acceleration = acceleration;
	}

	public int getPurchase() {
		return purchase;
	}

	public void setPurchase(int purchase) {
		this.purchase = purchase;
	}

	/**
	 *@return,for 
	 */
	
	private void setup() {
	Random rnd = new Random();
	for(int i = 0; i<18;i++){
		switch(rnd.nextInt(3)){
		case 0:
			speed++;
			break;
		case 1:
			acceleration++;
			break;
		case 2:
			purchase++;
			break;
		}
	}
	
	
		
	}
	public int move(){
		Random rnd = new Random();
		return speed+acceleration+rnd.nextInt(6);
		
	}
	
	public int handle(){
		Random rnd = new Random();
		return purchase+rnd.nextInt(6);
		
	}
	

}
